require("./mine.less");
// // 引入页面底部模板
// require("../../assets/css/ZJF-tapbar.less");
let tapbar = require("../../assets/js/zjf-dom.js");
// 引入axios
const axios = require("axios");
window.addEventListener("load", function () {
	axios.defaults.baseURL = "http://fitness.h5.itsource.cn:3701";
	let token = localStorage.getItem("token");
	axios.defaults.headers.common["Authorization"] = "Bearer " + token;
	// 获取方法
	function $(v) {
		return document.querySelector(v);
	}
	tapbar.nav("mine");
	$("#mineData").addEventListener("click", function () {
		location.href = "./mine_data.html";
	});
	// 用户信息
	$("#userdata").addEventListener("click", function () {
		location.href = "./mine_information.html";
	});
	axios.get("http://fitness.h5.itsource.cn:3701/api/user/info").then((v) => {
		$("#photo img").src =
			"http://fitness.h5.itsource.cn:3701" + v.data.data.imgUrl;
		$("#username").textContent = v.data.data.nickName;
		$("#sign").textContent = v.data.data.sign;
	});
});
